const int LEDpin=13;
const int photoPIN=A0;
void setup() {
// put your setup code here, to run once:
//initalizing the serial communication:
Serial.begin(9600);
pinMode(A0, INPUT); //Status of LDR
pinMode(13, OUTPUT); //Street Light
int sensorStatus=analogRead(photoPIN);
}
void loop() {
// put your main code here, to run repeatedly:
//read the sensor:
int x=analogRead(A0);
if(x<200)
{
digitalWrite(13, LOW); //Street Light must be ON
Serial.println("It's Bright");
}
else
{
digitalWrite(13, HIGH);
Serial.println("Welome to my DARK SIDE");
}
//now, it will check the reading or status of the sensor
//if it is,
}